using System.ComponentModel.DataAnnotations;

namespace ClassDemo.Model.DTO;

/// <summary>
/// 教师登录数据传输对象
/// </summary>
/// <remarks>
/// 用于教师登录接口的请求参数，包含手机号和密码验证信息
/// </remarks>
/// <example>
/// {
///   "mobile": "13800138000",
///   "password": "123456"
/// }
/// </example>
public class TeacherLoginDto
{
    /// <summary>
    /// 教师手机号，用作登录账号
    /// </summary>
    /// <value>
    /// 必须是有效的手机号格式，例如：13800138000
    /// </value>
    [Required(ErrorMessage = "手机号不能为空")]
    [Phone(ErrorMessage = "手机号格式不正确")]
    public string Mobile { get; set; } = string.Empty;

    /// <summary>
    /// 登录密码
    /// </summary>
    /// <value>
    /// 密码长度不能少于6位，建议使用字母数字组合
    /// </value>
    [Required(ErrorMessage = "密码不能为空")]
    [MinLength(6, ErrorMessage = "密码长度不能少于6位")]
    public string Password { get; set; } = string.Empty;
}